﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Xml.Serialization;
using Transformer.iHunter;

namespace Transformer.iHunter
{

    
    /// <summary>
    /// The interface of the plugin component
    /// </summary>
    public interface IPlugin :IDisposable
    {
        /// <summary>
        /// Gets the GUID.
        /// </summary>
        /// <value>The GUID.</value>
        Guid Guid { get; }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        string Name { get; }

        /// <summary>
        /// Gets the description.
        /// </summary>
        /// <value>The description.</value>
        string Description { get; }
        /// <summary>
        /// Initializes the plugin instance with the specified settings.
        /// </summary>
        /// <param name="client">The client that hold the plugin.</param>
        void Initialize(IPluginClient client);


        /// <summary>
        /// Gets the plugin configure editor.
        /// </summary>
        /// <returns>The configure editor, or <c>null</c> if this plugin is not configurable</returns>
        /// <remarks>
        /// A configure editor is a Windows Forms user control <see cref="System.Windows.Forms.UserControl"/> 
        /// and it must implement <see cref="System.Xml.Serialization.IXmlSerializable"/> interface.
        /// The user control will be shown while the user editing the settings of a channel provided by this channel provider.
        /// The <see cref="System.Xml.Serialization.IXmlSerializable"/> interface is used to set and retreive settings
        /// from the editor control.
        /// </remarks>
        UserControl GetPluginConfigureEditor();


        /// <summary>
        /// Occurs when operation fails.
        /// </summary>
        event PluginErrorEventHandler ErrorOccur;
    }

}
